import { useRouter } from "vue-router"
const router = useRouter()
//路由跳转
export const gopath = (path: string, id?: any) => {
    if (id) {
        router.push({
            path: path,
            query: {
                id
            }
        })
    } else {
        router.push({
            path
        })
    }
}

export const compongo = () => {
    const router = useRouter()
    const go = () => {
        router.go(-1)
    }
    const go1 = (index) => {
        router.go(index)
    }
    return { go, go1 }
}
